import {Injectable} from "@angular/core";
import {HttpHelper} from "./HttpHelper";
import {WorkShop} from "./domains";

@Injectable()
export class WorkShopService {

    constructor(private httpHelper:HttpHelper){

    }

    getWorkShops(age?:number,size?:number,getAll?:boolean):Promise<WorkShop[]>{
        let url = "workshop";
        if (getAll) {
            url = url+`/?all=${getAll}`
        }
        return this.httpHelper.getJson<WorkShop[]>(url);
    }
}